import React, { FC } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import { ActivitiesContext, useActivitiesExhibitionList } from '@/pages/MyActivities/MyActivitiesContext';
import ActivitiesTitle from './ActivitiesTitle/ActivitiesTitle';
import ActivitiesItem from './ActivitiesItem/ActivitiesItem';
export interface IProps extends ICompProps {}
ActivitiesList.defaultProps = {} as Partial<IProps>;
function ActivitiesList(props: IProps) {
    const { className, style } = props;
    const localClassName = useClassName('ActivitiesList', className);
    const { activitiesExhibitionState } = useActivitiesExhibitionList();
    return (
        <RootView className={localClassName} style={style}>
            <ActivitiesTitle>热门活动</ActivitiesTitle>
            <View className="List">
                {activitiesExhibitionState.activitiesList.map((active) => (
                    <ActivitiesItem {...active} key={active.id}></ActivitiesItem>
                ))}
            </View>
        </RootView>
    );
}
export default React.memo(ActivitiesList as FC<IProps>);
const RootView = styled(View)`
    &.ActivitiesList {
        .List{
            width: 690px;
            margin:0 auto;
            margin-top: 48px;
        }
    }
`;
